package com.guo.hui.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;

import com.guo.hui.model.shiro.TpUser;

public class BaseController {

	Session session = null;

	public Session GetSession() {
		return SecurityUtils.getSubject().getSession();
	}

	public TpUser getUserInfo() {
		session = GetSession();
		TpUser tpUser = (TpUser) session.getAttribute("user");
		if (tpUser != null) {
			return tpUser;
		}
		return null;
	}

}
